package com.ruoyi.ies.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ies.mapper.WorkingVehicleMapper;
import com.ruoyi.ies.domain.WorkingVehicle;
import com.ruoyi.ies.service.IWorkingVehicleService;

/**
 * 车辆Service业务层处理
 * 
 * @author July
 * @date 2023-06-05
 */
@Service
public class WorkingVehicleServiceImpl implements IWorkingVehicleService 
{
    @Autowired
    private WorkingVehicleMapper workingVehicleMapper;

    /**
     * 查询车辆
     * 
     * @param vehicleId 车辆主键
     * @return 车辆
     */
    @Override
    public WorkingVehicle selectWorkingVehicleByVehicleId(Long vehicleId)
    {
        return workingVehicleMapper.selectWorkingVehicleByVehicleId(vehicleId);
    }

    /**
     * 查询车辆列表
     * 
     * @param workingVehicle 车辆
     * @return 车辆
     */
    @Override
    public List<WorkingVehicle> selectWorkingVehicleList(WorkingVehicle workingVehicle)
    {
        return workingVehicleMapper.selectWorkingVehicleList(workingVehicle);
    }

    /**
     * 新增车辆
     * 
     * @param workingVehicle 车辆
     * @return 结果
     */
    @Override
    public int insertWorkingVehicle(WorkingVehicle workingVehicle)
    {
        workingVehicle.setCreateTime(DateUtils.getNowDate());
        return workingVehicleMapper.insertWorkingVehicle(workingVehicle);
    }

    /**
     * 修改车辆
     * 
     * @param workingVehicle 车辆
     * @return 结果
     */
    @Override
    public int updateWorkingVehicle(WorkingVehicle workingVehicle)
    {
        return workingVehicleMapper.updateWorkingVehicle(workingVehicle);
    }

    /**
     * 批量删除车辆
     * 
     * @param vehicleIds 需要删除的车辆主键
     * @return 结果
     */
    @Override
    public int deleteWorkingVehicleByVehicleIds(Long[] vehicleIds)
    {
        return workingVehicleMapper.deleteWorkingVehicleByVehicleIds(vehicleIds);
    }

    /**
     * 删除车辆信息
     * 
     * @param vehicleId 车辆主键
     * @return 结果
     */
    @Override
    public int deleteWorkingVehicleByVehicleId(Long vehicleId)
    {
        return workingVehicleMapper.deleteWorkingVehicleByVehicleId(vehicleId);
    }
}
